<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<!-- 生产环境版本，优化了尺寸和速度 -->
<!-- <script src="https://cdn.jsdelivr.net/npm/vue"></script> -->

<!-- 本地版本，引入vue -->
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>

<body>

    <!-- 条件v-if -->
    <div id="app-3">
        <p v-if="seen">现在你看到我了</p>
        <button v-on:click="seen = !seen">显示/隐藏按钮 </button>
    </div>

    <div id="app-4">
        <ol>
            <li v-for="todo in todos">
                {{ todo.text }}
            </li>
        </ol>
    </div>


    <script>
        // 条件 v-if
        var app3 = new Vue({
            el: '#app-3',
            data: {
                seen: true
            }
        })

        var app4 = new Vue({
                el: '#app-4',
                data: {
                    todos: [
                        { text: '学习 JavaScript' },
                        { text: '学习 Vue' },
                        { text: '整个牛项目' }
                    ]
                }
            })
    </script>

</body>

</html>